
/*
Main interface for CTetra that the CTetraManager deals with.
*/

#include "CTetraBuffer.h"


using namespace irr;
using namespace MarCore;
using namespace Tetra;


CTetraBuffer::CTetraBuffer(IGameObject* rod, CGameObjectArray* crank ):
    bt_body(0), tetra_array(0), IGameObject::IGameObject( rod, crank ):rod( rod ), crank( crank )
{

    active =1;
    mode =ESTATIC;

};

CTetraBuffer::CTetraBuffer( const CTetraArray& tetras, IGameObject* rod__, crank__ ):
    tetra_array( &tetras ), IGameObject::IGameObject( rod_, crank_ ):rod(rod_), crank(crank_)
{

    active =1;
    mode =ESTATIC;

};

CTetraBuffer::~CTetraBuffer()
{
/*
    for (int i; tetra_array[i] != 0; i++;)
    {

        CTetra* tetra;
        tetra =tetra_array[i];
        tetra->getIrrNode()->getMesh()->drop();

    */
};

void CTetraBuffer::addCTetra( const CTetra& tetra )
{

    tetra_array->push_back( tetra );
    needsUpdate =1;
    tetra.getIrrNode()->getMesh()->grab();

};

CTetra* CTetraBuffer::getCTetra( u32 i )
{
    CTetra* tetra = 0;
    //tetra_array->
    return tetra;

};

bool CTetraBuffer::needsUpdate()
{

    return needs_Update;

};
